$(document).ready(function() {
	$(window).scroll(function() {
		var initoffset = $('#floatingcontainer').offset();
		var currenttop = $(window).scrollTop();

		if (currenttop > initoffset.top) {
			$('#floatingmenu').css({
				position : 'fixed',
				opacity : 1,
				top : 0,
				background : '#333'
			});
			$('#floatingmenu a').css({
				color : '#B3D754'
			});
			$('#floatingmenu .outside a').css({
				color : '#DD4B39'
			});
		}

		if ($('#floatingmenu').css('position') == 'fixed') {
			if (currenttop < initoffset.top) {
				$('#floatingmenu').css({
					position : 'static',
					opacity : 0.85,
					background : '#303030'
				});
				$('#floatingmenu a').css({
					color : '#fff'
				});
			}
		}
	});
});
